package com.baojiaren.config;

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author ✎ℳ๓₯㎕.倾心❀、
 * @create 2021-07-15-18:28
 */
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
     super.configure(http); //加这句是为了访问eureka 控制台和 actuator 时能做安全控制
     http.csrf().ignoringAntMatchers("/eureka/**");//忽略 /eureka/**的所有请求
    }
}
